<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<tiles:insertDefinition name="defaultTemplate">
	<tiles:putAttribute name="body">

	<script type="text/javascript" src="${pageContext.request.contextPath}/resources/js/userManagement.js"></script>
	<script type="text/javascript">$(document).ready(function() {dataTable('${oLanguage}'); alertMessage('${status}','${message}'); if('${status}'=='success'){clearForm();}});</script>

		<div class="body">
		

				<div class="panel-heading">
					<h4><span class="text-success">User </span> <span style="color:#ccc; text-shadow:0 1px #fff"> Management</span></h4>

				</div>
				<div id="message"></div>
				<form:form method="POST" commandName="userLogin">
				<form:errors path="*" cssClass="alert alert-danger" element="div" />

					<div class=col-sm-7 style="margin-left: 23%;margin-top: 2%; margin-bottom: 3%;">
						<div class="row">
							<div class="form-group form-group-sm" style="text-align:right; top:2px;">
						      <label class="col-sm-3 control-label" for="inputUserId" style="margin-top:6px;"><spring:message code="field.UserId" /></label>
						      <div class="col-sm-6">
						        <input type="text" class="form-control input-sm" id="vaUserId" name="vaUserId" placeholder="<spring:message code="field.UserId" />" value="${userLogin.vaUserId}" data-required="true">
								<form:errors path="vaUserId" cssClass="error" />
						      </div>
						    </div>
						</div>
						<div class="row"  style="margin-top: 1%;">
							<div class="form-group form-group-sm" style="text-align:right; top:2px;">
						      <label class="col-sm-3 control-label" for="inputName" style="margin-top:6px;"><spring:message code="field.Name" /></label>
						      <div class="col-sm-6">
						        <input type="text" class="form-control input-sm" id="vaName" name="vaName" placeholder="<spring:message code="field.Name" />" value="${userLogin.vaName}" data-required="true">
						      </div>
						    </div>
						</div>
						<div class="row"  style="margin-top: 1%;">
							<div class="form-group form-group-sm" style="text-align:right; top:2px;">
						      <label class="col-sm-3 control-label" for="inputPosition" style="margin-top:6px;"><spring:message code="field.Position" /></label>
						      <div class="col-sm-6">
						        <input type="text" class="form-control input-sm" id="vaPosition" name="vaPosition" placeholder="<spring:message code="field.Position" />" value="${userLogin.vaPosition}" data-required="true">
						      </div>
						    </div>
						</div>
						
						<div class="row"  style="margin-top: 1%;">
							<div class="form-group form-group-sm" style="text-align:right; top:2px;">
						      <label class="col-sm-3 control-label" for="inputEmail" style="margin-top:6px;"><spring:message code="label.email" /></label>
						      <div class="col-sm-6">
						        <input type="text" class="form-control input-sm" id="vaEmailAddress" name="vaEmailAddress" placeholder="<spring:message code="label.email" />" value="${userLogin.vaEmailAddress}" data-required="true">
						      </div>
						    </div>
						</div>
						
						<div class="row"  style="margin-top: 1%;">
							<div class="form-group form-group-sm" style="text-align:right; top:2px;">
						      <label class="col-sm-3 control-label" for="inputStatus" style="margin-top:6px;"><spring:message code="field.Status" /></label>
						      <div class="col-sm-6">
						      	<form:select cssClass="form-control" path="vaStatus" itemValue="I">	
						        	<form:options items="${vaStatus}" />
								</form:select>
						      </div>
						    </div>
						</div>
						
						<div class="row"  style="margin-top: 1%;">
							<div class="form-group form-group-sm" style="text-align:right; top:2px;">
						      <label class="col-sm-3 control-label" for="inputUserName" style="margin-top:6px;"><spring:message code="label.userName" /></label>
						      <div class="col-sm-6">
						        <input type="text" class="form-control input-sm" id="vaUserName" name="vaUserName" placeholder="<spring:message code="label.userName" />" value="${userLogin.vaUserName}" data-required="true">
						      </div>
						    </div>
						</div>

						<input type="hidden" id="vaUserIdTemp" name="vaUserIdTemp" value="${userLogin.vaUserId}" >
						<input type="hidden" id="processType" name="processType" value="${processType}" >	
						<input type="hidden" id="vaSiteAndRoleId" name="vaSiteAndRoleId" value="${vaUserMapping}" >

				</div>
				</form:form>

				<form name="dataTable" id="dataTable">
					<table align="center" style="width: 95%;">
						<tr>
							<td>
							
							
							<table id="siteRoleData" class="table table-striped">
								<thead>
									<tr>
										<th>
											<label class="label-checkbox">
												<input type="checkbox" name="check_all" id="checkall"
												onClick="CheckAll()">
											<span class="custom-checkbox info" style="left:30px; width:0px; top:-8px;"></span>
											</label>
										</th> 
										<th><spring:message 
 										code="field.SiteId" /></th> 
										<th><spring:message 
 										code="field.SiteName" /></th>
 										<th><spring:message 
 										code="field.RoleId" /></th> 
										<th><spring:message 
 										code="field.RoleName" /></th> 
									</tr>
								</thead>
								
							</table>
							</td>
						</tr>
					</table>
					
					</form>
					<p align="center">
						<button type="button" class="btn btn-success btn-sm" onclick="submitForm()"><i class="fa fa-save"></i>&nbsp;<spring:message code="btn.save" /></button>
						<button type="button" class="btn btn-default btn-sm" onclick="clearForm()"><i class='fa fa-refresh'></i>&nbsp;<spring:message code="btn.clear" /></button>
					</p>
		</div>
	</tiles:putAttribute>
</tiles:insertDefinition>